home *** CD-ROM | disk | FTP | other *** search
- Path: dos.canit.se!news
- From: ottosson@canit.se (Stefan Ottosson)
- Newsgroups: comp.lang.c,comp.lang.c++
- Subject: I dont want BIOS to get the keystrokes..
- Date: Tue, 19 Mar 1996 13:44:12 GMT
- Organization: CanIt Public Access, Stockholm
- Message-ID: <4imdph$497@dos.canit.se>
- NNTP-Posting-Host: dslip03.canit.se
- X-Newsreader: Forte Free Agent 1.0.82
-
- why doesn┤t this work:? ( Borland C++)
-
- #include <dos.h>
- #define BIOSINT 0x9
-
- extern unsigned _heaplen = 1024;
- extern unsigned _stklen = 512;
-
- #ifdef __cplusplus
- #define __CPPARGS ...
- #else
- #define __CPPARGS
- #endif
-
- int n=0;
- void interrupt (*oldhandler)(__CPPARGS); // int 9h
- void interrupt keyb(__CPPARGS)
- {
- n++;
- }
-
- int main()
- {
- oldhandler = getvect(BIOSINT);
- setvect(BIOSINT,keyb);
- while (n < 30) {};
- setvect(BIOSINT,oldhandler);
- return 0;
- }
-
-
-
- what I┤m trying to do is to take over interupt 9h and do nothing until
- the interupt has been called 30 times, and then return to dos..
- It works if I call oldhandler() in keyb(), but I dont want to give the
- keystrokes to BIOS!!
-
-
-
- Stefan Ottosson, Stockholm, Sweden
- Email: ottosson@canit.se
-
-